public class Main {
    public static void main(String[] args) {
        // write your code here
        // output the answer to the console according to the
        // requirements of the question
        A aa = new A();
        for(int i=100; i<1000; i++)
        {
            if(aa.way(i) == 1)
            {
                System.out.println(i);
            }
        }
    }
}
class A{
    public int way(int n)
       {
            int _n = n;
            int a = 0, b = 0;
            a = _n % 10;
            _n /= 10;
            b = _n %10;
            _n /= 10;
            _n = _n*_n*_n + a*a*a + b*b*b;

            if(_n == n)
            {
                return 1;
            }
            else
            {
                return 0;
            }
        }
}